// @ts-ignore
/* eslint-disable */
import { requestAuth } from '@/utils/request';

/** 参数配置分页查询 **/
export async function sysConfigInfo(data: {
  current: number;
  size: number;
  params: {
    column: string;
    type: string;
    values?: string;
  }[];
}) {
  return requestAuth({
    method: 'POST',
    url: `/api/system/config/page`,
    data,
  });
}

/** 配置新增 */
export async function addSysConfigItem(data: {
  configKey?: string;
  configName?: string;
  configType?: string;
  configValue?: string;
}) {
  return requestAuth({
    method: 'POST',
    url: `/api/system/config/save`,
    data,
  });
}

/** 配置修改 */
export async function updateSysConfigItem(data: {
  configKey?: string;
  configName?: string;
  configType?: string;
  configValue?: string;
  id;
}) {
  return requestAuth({
    method: 'POST',
    url: `/api/system/config/update`,
    data,
  });
}

/** 配置删除 */
export async function deleteConfigItemById(data: { id: string }) {
  return requestAuth({
    method: 'POST',
    url: `/api/system/config/delete`,
    data,
  });
}

/** 配置（批量）删除 */
export async function batchDeleteConfigById(data: { ids: string[] }) {
  return requestAuth({
    method: 'POST',
    url: `/api/system/config/deleteBatch`,
    data,
  });
}
